<?php
$page_title = 'eTAT: Course';
require_once 'controller.php';
if($params->c != '') {
	$course = $instructor->getCourse($params->c);
	$groups = $course->getAllGroups();
} else {
	redirect('myetat.php');
}
if(isset($_POST['add_group_submit'])) {
	unset($_SESSION['add_project']);
	$_SESSION['add_project']->course = $course->id;
	$_SESSION['add_project']->step = 0;
	redirect('addgroup.php');
}
$courses = $instructor->getAllCourses();
require_once 'header.php';
?>
<?php include_once('leftmenu.php');?>
	<div id="right" >
	<div class="right"> <?php print "<a href='addgroup.php?c=$course->id'>Add Group</a>";?></div>
	<h2>Groups</h2>
	<?php
// 	print newBtn('add_group','Add Group',array('type'=>'button','onclick'=>"window.location(&#39addgroupNew.php?c=$course->id&#39)"));
if(isset($groups)) {
	foreach($groups as $g) {
		print "<div id='$g->id-details'>";
		print "<ul class='indent'><li><a href='groupdetail.php?g=$g->id'>$g->name</a>";
		print "<li>SVN Commits: {$g->getSVNCount()}</li>
				<li>Wiki Updates: {$g->getWikiCount()}</li>
				<li>Forum Posts: {$g->getForumCount()}</li>
				<li>Files: {$g->getFileCount()}</li>
				<li>Issue Tracker Updates: {$g->getIssueCount()}</li>";
		print '</li></ul></div>';
	}
} else {
?>
<div id='update-msg'><p>Looks like you haven't added any groups for monitoring, yet.Let's get started by pressing the <b>Add Group</b> button below:</p>
</div>
<?php
}
?>
	</div>
	<div id="main" >
        <div class = "right"><a href=""> Course Detail </a>| <a href="">Edit Course</a></div>
        <h1 style="text-align:center"> <?php print $course->title; ?></h1>
	    <h2>Annotations</h2>
	    <p>Annotations are the observations of the teamwork activitites logged by the instructors.</p>
	    <div><input type="button" value="Create Annotations"> | <input type="button" value="View/Edit Annotations"></div> <br />
	    <h2>Survey</h2>
	    Surveys are developed for the self assessment of teamwork. The result from the survey will be used for the future advancement and 	improvement
	    <div><input type="button" value="Survey"></div> <br />
	    <h2>Report</h2>
	    Reports provide the detailed description as well as the summary of the various teamwork activities collected by the eTAT tool.
	   <div><a href="reportgenerate.php"><input type="button" value="Generate Report"  onClick="document.location='reportgenerate.php'"/></a></div>
    </div>
<?php require_once 'footer.php'; ?>